Wireless communication apparatus for wireless network and computer readable media

ABSTRACT

A wireless communication apparatus may operate selectively as a master station or as a remote station in a wireless network. When the apparatus operates as the master station, the apparatus may manage one or more remote devices that operate as remote stations. The apparatus continues operating as the master station until a continuation period elapses when the number of remote devices to be managed is zero. The continuation period begins when the number of remote devices becomes zero. If the number of remote devices becomes one or more before the continuation period elapses, the apparatus continues operating as the master station, even after a lapse of the continuation period. If the number of remote devices remains zero until the continuation period elapses, the apparatus stops operating as the master station after the lapse of the continuation period.

CROSS-REFERENCE TO RELATED APPLICATION

The present application claims priority from Japanese Patent ApplicationNo. 2011-133611, filed on Jun. 15, 2011, which is incorporated herein byreference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates generally to wireless communicationapparatus capable of selectively operating as a master station or as aremote station in a wireless network and to non-transitory computerreadable media providing instructions for such wireless communicationapparatus.

2. Description of Related Art

“Wi-Fi Peer-to-Peer (P2P) Technical Specification Version 1.1” (Wi-FiAlliance, 2010) describes Wi-Fi Direct protocols (hereinafter referredto as “WFD”) designed by Wi-Fi Alliance. A wireless network according toWFD may comprise a single device (hereinafter referred to as the “G/Odevice”) that operates as a group owner and one or more devices(hereinafter referred to as the “client device(s)”) that operate asclients managed by the G/O device. In the protocols disclosed in “Wi-FiPeer-to-Peer (P2P) Technical Specification Version 1.1,” the G/O deviceimmediately stops operating as a G/O when the number of client devicesmanaged thereby becomes zero. As a result, the wireless network may beimmediately lost. In such a case, for example, the wireless networkneeds to be constructed again immediately after being lost.

The above-described problem applies not only to an apparatus accordingto WFD, but also to other communication apparatus, each capable ofselectively operating as a master station or as a remote station.

SUMMARY OF THE INVENTION

According to embodiments of the present invention, a master deviceoperating as a master station in a wireless network may executeoperations as the master station. A wireless communication apparatusconfigured to operate selectively as a master station or as a remotestation in a wireless network may comprise: a processor configured tooperate as: a management unit configured to manage one or more remotedevices that operate as remote stations in a particular wirelessnetwork, when the wireless communication apparatus operates as themaster station in the particular wireless network; and an operationcontrol unit configured to continue the operation of the wirelesscommunication apparatus as the master station, when the wirelesscommunication apparatus operates as the master station in the particularwireless network, until a continuation period elapses when the number ofremote devices to be managed is zero. The continuation period may beginat the time when the number of remote devices to be managed becomeszero. If the number of remote devices to be managed increases to one ormore before the continuation period elapses, the operation control unitmay continue the operation of the wireless communication apparatus asthe master station in the particular wireless network, even after alapse of the continuation period. If the number of remote devices to bemanaged remains zero until the continuation period elapses, theoperation control unit may stop the operation of the wirelesscommunication apparatus as the master station after the lapse of thecontinuation period.

According to other embodiments of the present invention, the wirelesscommunication apparatus may not stop operating as a master stationimmediately, even if the number of remote devices becomes zero (e.g.,operation as the master station may continue during a continuationperiod). If the number of remote devices becomes one or more before thecontinuation period elapses, the wireless communication apparatus maycontinue operating as a master station, even after the lapse of thecontinuation period. If the number of remote devices remains zero untilthe continuation period elapses, the wireless communication apparatusmay stop operating as a master station after the lapse of thecontinuation period. In other words, the wireless communicationapparatus may either continue or stop operating as a master station inaccordance with whether or not the number of remote devices becomes oneor more before the continuation period elapses. Therefore, the wirelesscommunication apparatus may execute operations as a master station. As aresult, for example, the wireless network need not be constructed againimmediately after being lost.

According to still other embodiments of the invention, a non-transitory,computer-readable storage medium may comprise computer-readableinstructions for a processor of a wireless communication apparatusconfigured to operate selectively as a master station or as a remotestation in a wireless network. The computer-readable instructions mayinstruct the processor to perform the steps of: managing one or moreremote devices that operate as remote stations in the particularwireless network, when the wireless communication apparatus operates asthe master station in a particular wireless network; and controlling theoperation of the wireless communication apparatus to continue as themaster station, when the wireless communication apparatus operates asthe master station in the particular wireless network, until acontinuation period elapses when the number of remote devices to bemanaged is zero. The continuation period may begin at a time when thenumber of remote devices to be managed becomes zero. The controllingstep may comprise continuing the operation of the wireless communicationapparatus as the master station in the particular wireless network, evenafter a lapse of the continuation period, if the number of remotedevices to be managed becomes one or more before the continuation periodelapses. The controlling step also may comprise stopping the operationof the wireless communication apparatus as the master station after thelapse of the continuation period, if the number of remote devices to bemanaged remains zero until the continuation period elapses.

According to yet other embodiments of the invention, a wirelesscommunication apparatus configured to operate selectively as a masterstation or a remote station in a wireless network may comprise: amanagement unit configured to manage one or more remote devices thatoperate as remote stations in the particular wireless network, when thewireless communication apparatus operates as the master station in aparticular wireless network; and an operation controller configured tocontinue the operation of the wireless communication apparatus as themaster station, when the wireless communication apparatus operates asthe master station in the particular wireless network, until acontinuation period elapses when the number of remote devices to bemanaged is zero. The continuation period may begin at a time when thenumber of remote devices to be managed becomes zero. If the number ofremote devices to be managed becomes one or more before the continuationperiod elapses, the operation controller may continue the operation ofthe wireless communication apparatus as the master station in theparticular wireless network, even after a lapse of the continuationperiod. If the number of remote devices to be managed remains zero untilthe continuation period elapses, the operation controller may stop theoperation of the wireless communication apparatus as the master stationafter the lapse of the continuation period.

Other objects, features, and advantages will be apparent to persons ofordinary skill in the art from the following detailed description ofembodiments of the invention and the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

For a more complete understanding of the present invention, needssatisfied thereby, and the objects, features, and advantages thereof,reference now may be made to the following descriptions taken inconnection with the accompanying drawings.

FIG. 1 depicts an exemplary configuration of a communication system.

FIG. 2 is a flowchart depicting a wireless communication process.

FIG. 3 is a flowchart depicting a G/O process.

FIG. 4 is a flowchart depicting a G/O stop process according to anembodiment of the invention.

FIG. 5 depicts specific examples according to an embodiment of theinvention.

FIG. 6 is a flowchart depicting a G/O stop process according to anotherembodiment of the invention.

FIG. 7 depicts specific examples according to the another embodiment.

FIG. 8 is a flowchart depicting a G/O stop process according to afurther embodiment of the invention.

FIG. 9 depicts specific examples according to the further embodiment ofthe invention.

FIG. 10 depicts a specific example according to an additional embodimentof the invention.

DETAILED DESCRIPTION OF EMBODIMENTS OF THE INVENTION Configuration ofSystem

As depicted in FIG. 1, a communication system 2 may have printers 10 and70, a mobile terminal 80, and a personal computer (PC) 90. These devices10, 70, 80, and 90 may execute a wireless communication functionaccording to WFD, which are described hereafter in more detail. Thewireless communication function according to WFD is referred to as the“WFD function” hereinafter. The devices 10, 70, 80, and 90 may comprisea wireless network by establishing wireless connection in accordancewith WFD. As a result, the devices 10, 70, 80, and 90 may executewireless communication of target data to be communicated, such as printdata.

(Configuration of Printer 10)

The printer 10 may have a display unit 12, an operation unit 14, awireless interface 16, a print execution unit 20, and a control unit 22.These components 12 to 22 may be connected to a bus (reference numeralomitted). The display unit 12 may be a display for displaying variouspieces of information. The operation unit 14 may comprise a plurality ofkeys. Operation of the operation unit 14 may issue various instructionsto the printer 10. The wireless interface 16 may be an interface forexecuting wireless communication. The wireless interface 16 may comprisea wireless chip set 17, for example, “BCM4319” manufactured and sold byBroadcom Corp. The functions of the wireless chip set 17 are describedhereafter in more detail. The print execution unit 20 may have a printmechanism adopting a method, such as an inkjet method or a laser method,and may execute printing in accordance with an instruction from thecontrol unit 22.

The control unit 22 may have a central processing unit (CPU) 30 and amemory 32. The CPU 30 may execute various processes in accordance withprograms 34 stored in the memory 32. The memory 32 may comprise aread-only memory (ROM), a random-access memory (RAM), a hard disk, orthe like. The memory 32 may store a management list 36, which isdescribed hereafter in more detail, in addition to the programs 34. Aholding period table 38, indicated by broken lines, may be utilized inembodiments of the invention. A management unit 40 and an operationcontrol unit 42 may function according to processes or instructionsexecuted by the CPU 30, in accordance with the programs 34. Theoperation control unit 42 may have an information obtaining unit 44, acontinuation period determination unit 46, and a holding perioddetermination unit 48. The holding period determination unit 48 may be afunction utilized in embodiments of the invention.

(Configurations of Printer 70, Mobile Terminal 80, and PC 90)

The printer 70 may have a similar configuration to the printer 10 or mayhave a configuration that differs in various aspects with the printer10. Each of the mobile terminal 80 and the PC 90 may have a CPU, amemory, and a display, which are not depicted.

(WFD)

As described above, the devices 10, 70, 80, and 90 may execute the WFDfunction. WFD is described in “Wi-Fi Peer-to-Peer (P2P) TechnicalSpecification Version 1.1,” created by the Wi-Fi Alliance. In WFD, threestates, namely a group owner state (hereinafter referred to as the “G/Ostate”), a client state, and a device state, may be defined as thestates of a device. The devices (e.g., the printers 10 and 70, themobile terminal 80, and the PC 90), which may execute the WFD function,may be capable of selectively operating in one of the three states.

A single wireless network may be configured to comprise a device in theG/O state and a device in the client state. In a single wirelessnetwork, the number of devices in the G/O state may be invariably one,but the number of devices in the client state may be one or more. Adevice in the G/O state may manage one or more devices in the clientstate. More specifically, the device in the G/O state may store amanagement list (e.g., management list 36, depicted in FIG. 1), whichmay comprise identification information (e.g., media access control(MAC) addresses) regarding the one or more devices in the client state.When a device in the client state has newly joined the wireless network,the device in the G/O state may add identification information regardingthe joined device in the client state to the management list, and when adevice in the client state has been removed from the wireless network,the device in the G/O state may delete identification informationregarding the removed device in the client state from the managementlist.

The device in the G/O state may execute wireless communication of targetdata, such as data (e.g., print data) comprising information in thenetwork layer of the Open Systems Interconnections (OSI) model, to becommunicated with devices registered in the management list, i.e.,devices in the client state. Nevertheless, while the device in the G/Ostate may execute wireless communication of data (for example, data thatdoes not comprise information in the network layer (i.e., data in thephysical layer, such as a probe request signal or a probe responsesignal)) for joining a device that has not been registered in themanagement list to the wireless network with the device, the device inthe G/O state may not execute wireless communication of theabove-described target data. For example, the printer 10 in the G/Ostate may receive print data wirelessly from the mobile terminal 80registered in the management list 36 (i.e., the mobile terminal 80 inthe client state), but may not receive print data wirelessly from amobile terminal that is not registered in the management list 36.

In addition, the device in the G/O state may relay wirelesscommunication of target data (e.g., print data) between a plurality ofdevices in the client state. For example, when the mobile terminal 80 inthe client state wirelessly transmits print data to the other printer 70in the client state, the mobile terminal 80 first wirelessly transmitsthe print data to the printer 10 in the G/O state, and the printer 10then wirelessly transmits the print data to the printer 70. In otherwords, the device in the G/O state may function as an access point (AP)in a wireless network.

A device that has not joined a wireless network (i.e., a device that hasnot been registered in the management list) may be a device in thedevice state. A device in the device state may execute wirelesscommunication of data for joining a wireless network, but may notexecute wireless communication of target data (e.g., print data or thelike) through the wireless network.

(Method for Executing Wireless Connection According to WFD)

As a method for executing wireless connection according to WFD, wirelessconnection methods according to Wi-Fi Protected Setup (WPS) may be used.The wireless connection methods according to WPS may comprise a PushButton Configuration (PBC) method and a Personal Identification Number(PIN) code method. In either method, to establish a wireless connectionbetween a pair of devices (e.g., the printer 10 and the printer 70), thepair of devices may execute a WPS negotiation (described hereafter inmore detail). In the PIN code method, a PIN code, displayed on one ofthe devices, may be input to the other device. On the other hand, in thePBC method, certain operations corresponding to pressing buttonsprovided on each of the devices may be performed.

(Wireless Connection Process)

Referring to FIG. 2, details of a wireless connection process executedby the printer 10 in the device state now are described. In FIG. 2, theprinter 10 may wirelessly communicate with other devices.

While a power supply of the printer 10 is on, the control unit 22 of theprinter 10 may monitor whether or not an operation for selecting amethod is performed (S10). The operation for selecting a method (e.g.,the PIN code method or the PBC method) through the operation unit 14 ofthe printer 10 may be performed. When the PBC method is selected, theoperation for selecting a method may correspond to pressing buttonsprovided on each of the devices. When the operation for selecting amethod has been performed, the control unit 22 judges S10 to be YES, andthe process may proceed to S12.

At S12, the information obtaining unit 44 (depicted in FIG. 1) mayexecute a scan process. The scan process may be a process for searchingfor a device in the G/O state (hereinafter referred to as the “G/O statedevice”) around the printer 10. A G/O state device may use one of firstto thirteenth channels. Therefore, the information obtaining unit 44 mayuse the thirteen channels sequentially, i.e. the first to thirteenthchannels, in the scan process in order to sequentially transmit proberequest signals.

Upon receiving a probe request signal from the printer 10, a G/O statedevice may transmit a probe response signal to the printer 10. The proberesponse signal transmitted from the G/O state device may comprise anInformation Element (IE) and the MAC address of the G/O state device.The IE may comprise information indicating that the G/O state device isin the G/O state and information indicating a device name and acategory, such as the printer, the PC, the mobile terminal, or the like,of the G/O state device. The information obtaining unit 44 may analyzeprobe response signals received in the scan process in order to find G/Ostate devices around the printer 10 and obtain information regarding theG/O state devices that have been found.

A device in the device state (hereinafter referred to as the “devicestate device”) may use one of the first, sixth, and eleventh channels.Therefore, when there is another device state device around the printer10, this device state device also may receive a probe request signalfrom the printer 10 and may transmit a probe response signal to theprinter 10. Nevertheless, the probe response signal from the devicestate device may comprise information indicating that the device statedevice is in the device state. A device in the client state (hereinafterreferred to as the “client state device”) does not transmit a proberesponse signal to the printer 10, even if the client state devicereceives a probe request signal from the printer 10. Therefore, byreceiving probe response signals from devices around the printer 10 inthe scan process, the information obtaining unit 44 may find G/O statedevices.

At S14, the control unit 22 may execute a listen process. The listenprocess may be a process for responding to a probe request signaltransmitted from another device state device that may be executing asearch process (S16), which is described hereafter in more detail. Thus,upon receiving a probe request signal from the device state device, thecontrol unit 22 may transmit a probe response signal. The probe responsesignal from the printer 10 may comprise the IE and the MAC address ofthe printer 10. The IE may comprise information indicating that theprinter 10 is in the device state and information indicating the devicename and the category of the printer 10. Therefore, because the controlunit 22 may transmit the probe response signal in the listen process,the device state device may find the printer 10 in the device state.

At S16, the information obtaining unit 44 may execute the searchprocess. The information obtaining unit 44 may use the three channelssequentially, e.g., the first, sixth, and eleventh channels, in order tosequentially transmit probe request signals. Therefore, the informationobtaining unit 44 may receive probe response signals wirelessly fromother device state devices. Each probe response signal from a devicestate device may comprise the IE and the MAC address of the device statedevice. The IE may comprise information indicating that the device statedevice is in the device state and information indicating the device nameand the category of the device state device. Therefore, the informationobtaining unit 44 may analyze probe response signals received in thesearch process in order to find other device state devices around theprinter 10, and may obtain information regarding the device statedevices that have been found.

Another G/O state device also may transmit a probe response signal tothe printer 10 in response to a probe request signal transmitted in thesearch process. Nevertheless, the probe response signal may compriseinformation indicating that the other G/O state device is in the G/Ostate. As described above, a client state device may not transmit aprobe response signal to the printer 10, even if the client state devicereceives a probe request signal from the printer 10. Therefore, byreceiving probe response signals from devices around the printer 10 inthe search process, the information obtaining unit 44 may find devicestate devices.

At S18, the control unit 22 may cause the display unit 12 to display adevice list. The device list may comprise the information regarding eachdevice found in S12 and S16 (i.e., the information indicating the stateof each device and the device name, the category, and the MAC address ofeach device obtained in S12 and S16). In the example depicted in FIG. 2,information (e.g., the G/O state, the printer, and the MAC address)regarding a device corresponding to a device name: “XXX” and information(e.g., the device state, the PC, and the MAC address) regarding a devicecorresponding to a device name: “YYY” may be displayed on the displayunit 12 at S18.

Devices around the printer 10 may be recognized by looking at the devicelist displayed at S18. An operation for selecting a device through theoperation unit 14 may be performed in order to select a device withwhich the printer 10 may establish wireless connection. When theoperation for selecting a device has been performed, the process mayproceed to S20. A device (for example, the printer 70) selected by theoperation for selecting a device is referred to as the “target device,”hereinafter.

At S20, the control unit 22 may judge whether or not the target deviceis in the device state. If the target device selected by the user is inthe device state (for example, if the device corresponding to the devicename: “YYY,” depicted in FIG. 2, is selected), the control unit 22 mayjudge S20 to be YES, and the process may proceed to S22. On the otherhand, if the target device is in the G/O state (for example, if thedevice corresponding to the device name: “XXX,” depicted in FIG. 2, isselected), the control unit 22 may judge S20 to be NO, and the processmay proceed to S24, without executing S22.

For example, if the method selected at S10 is the PIN code method, thecontrol unit 22 may generate a PIN code and may cause the display unit12 to display the PIN code at a timing between S20 and S22. In thiscase, the PIN code displayed on the display unit 12 may be input to thetarget device. Although an example in which a PIN code may be displayedby the printer 10 and input to the target device has been described, aPIN code may be displayed by the target device and input to the printer10. When the PIN code has been displayed and input, the control unit 22may execute a G/O negotiation with the target device at S22. Asdescribed above, a single wireless network invariably may comprise onlyone G/O state device. Therefore, by executing the G/O negotiation, thecontrol unit 22 may determine either the printer 10 in the device stateor the target device in the device state to be a G/O, and the other tobe a client. On the other hand, for example, if the method selected inS10 is the PBC method, a PIN code may be neither displayed nor input ata timing between S20 and S22. In this case, the control unit 22 mayexecute a G/O negotiation with the target device at S22.

In the G/O negotiation executed at S22, the control unit 22 may transmitinformation indicating the G/O priority of the printer 10 to the targetdevice, as well as receive information indicating the G/O priority ofthe target device from the target device. The G/O priority of theprinter 10 may be an index indicating how appropriate the printer 10 maybe for a G/O, and may be predetermined in the printer 10. Similarly, theG/O priority of the target device may be an index indicating howappropriate the target device may be for a G/O. For example, a devicehaving a CPU and a memory with a relatively high performance (e.g., aPC) may operate as a G/O while executing other processes at high speed.Therefore, the G/O priority of such a device may be set, such that thedevice is likely to be a G/O. On the other hand, for example, a devicehaving a CPU and a memory with a relatively low performance might not beable to operate as a G/O while executing other processes at high speed.Therefore, the G/O priority of such a device may be set, such that thedevice is not likely to be a G/O.

The control unit 22 may compare the G/O priority of the printer 10 andthe G/O priority of the target device. The control unit 22 may determinea device (the printer 10 or the target device) with a higher G/Opriority to be a G/O and a device (the target device or the printer 10)with a lower G/O priority to be a client. The target device maydetermine a G/O and a client using the same method as the printer 10based on the G/O priorities of the printer 10 and the target device.

At S22, the operation control unit 42, as depicted in FIG. 1, may switchthe state of the printer 10 from the device state to a determined state(i.e., the G/O state or the client state). The target device also mayswitch from the device state to a determined state (i.e., the clientstate or the G/O state). When the state of the printer 10 has beenswitched, the process may proceed to S24.

On the other hand, if the selected target device is in the G/O state(for example, if the device corresponding to the device name: “XXX,”depicted in FIG. 2, is selected), the control unit 22 may judge S20 tobe NO, and the process may proceed to S24 without executing S22. In thiscase, the G/O negotiation at S22 may not be executed, and the controlunit 22 may determine the state of the printer 10 to be the client stateand may switch the state of the printer 10 from the device state to theclient state. This may occur because the target device may be in the G/Ostate and, therefore, it may be preferable for the printer 10 to be inthe client state and managed by the target device. For example, if themethod selected at S10 is the PIN code method, a screen for displayingor inputting a PIN code may be displayed at a timing between S20 andS24, when S20 has been judged to be NO. At S22, the control unit 22 thenmay execute provisioning discovery for notifying the target device ofwhether the particular device (i.e., the printer 10 comprising thecontrol unit 22) displays or inputs the PIN code. On the other hand, forexample, if the method selected at S10 is the PBC method, the PIN codemay be neither displayed nor input at a timing between S20 and S24, whenS20 has been judged to be NO; and the control unit 22 may execute theprovisioning discovery for notifying the target device of the use of thePBC method. When the provisioning discovery has been executed, theprocess may proceed to S24. If S20 has been judged to be YES, thecontrol unit 22 may execute a process corresponding to the provisioningdiscovery during the G/O negotiation at S22. Therefore, when S20 hasbeen judged to be YES, the control unit 22 may not execute the processcorresponding to the provisioning discovery as an independent process.

At S24, the control unit 22 of the printer 10 may judge whether or notthe current state of the printer 10 is the G/O state. If S24 is judgedto be YES (e.g., the current state of the printer 10 is the G/O stateand the current state of the target device is the client state), theprocess may proceed to S26. On the other hand, if S24 is judged to be NO(e.g., the current state of the printer 10 is the client state, and thecurrent state of the target device is the G/O state), the process mayproceed to S32.

At S26, the control unit 22 may execute a WPS negotiation for the G/Ostate. For example, if the method selected in S10 is the PIN codemethod, the control unit 22 may convert particular data (for example,latest packet data communicated between the printer 10 and the targetdevice) into a hash code using the PIN code displayed by the printer 10or input to the printer 10. On the other hand, the target device mayconvert particular data into a hash code using the PIN code input to thetarget device or displayed by the target device. Either the printer 10(the control unit 22) or the target device then may judge whether or notthe hash code generated by the printer 10 and the hash code generated bythe target device match. If the method selected at S10 is the PBCmethod, for example, each of the printer 10 (the control unit 22) andthe target device may convert particular data into a hash code using apredetermined PIN code. In addition, either the printer 10 or the targetdevice may judge whether or not the two hash codes match. In thisembodiment, a service set identifier (SSID), an authentication method,and an encryption method may be determined in advance. In addition, theSSID and a password (e.g., network key) may be generated by the controlunit 22 in the processing at S26 or may be determined in advance.

If the two hash codes match, i.e., if the authentication of the PIN codemay be completed, the control unit 22 may transmit the wireless profileto the target device. As a result, the printer 10 and the target devicemay use the same wireless profile.

At S28, the control unit 22 may execute a connection process in relationto the target device using the wireless profile. In other words, thecontrol unit 22 may execute wireless communication of an authenticationrequest, an authentication response, an association request, anassociation response, and a 4-way handshake with the target device,using the wireless profile. In this process, the printer 10 and thetarget device may execute various authentication processes, such asconfirmation of matching between passwords (e.g., network keys) thereof.When matching between passwords (e.g., network keys) has been confirmed,and the authentication process has been completed, wireless connectionmay be established between the printer 10 and the target device. Thus, awireless network comprising the printer 10 and the target device may beestablished. When matching between passwords (e.g., network keys) hasbeen confirmed, a key to be utilized for encrypting communication oftarget data may be generated.

At S30, the management unit 40 (depicted in FIG. 1) may register the MACaddress of the target device in the client state in the management list36, stored in the memory 32. The probe response signal, obtained in thesearch process at S16, may comprise the MAC address of the targetdevice. When S30 has been completed, the wireless connection process mayend.

At S32, the control unit 22 may execute a WPS negotiation for the clientstate. More specifically, the control unit 22 may receive a wirelessprofile (e.g., an SSID, an authentication method, an encryption method,and/or a password) necessary to establish wireless connection wirelesslyfrom the target device. For example, if the method selected in S10 isthe PIN code method, each of the printer 10 and the target device mayconvert particular data into a hash code using the PIN code displayed bythe printer 10 or input to the printer 10, and whether or not the twohash codes match may be determined. If the two hash codes match, thecontrol unit 22 may receive the wireless profile wirelessly from thetarget device. If the method selected at S10 is the PBC method, forexample, each of the printer 10 and the target device may convertparticular data into a hash code using a predetermined PIN code, andwhether or not the two hash codes match may be determined. If the twohash codes match, the control unit 22 may wirelessly receive thewireless profile from the target device. As a result, the printer 10 andthe target device may use the same wireless profile.

At S34, the control unit 22 may execute the connection process inrelation to the target device using the wireless profile in the samemanner as described above regarding S28. As a result, the wirelessconnection may be established between the printer 10 and the targetdevice. When S34 has been completed, the wireless connection process mayend.

For example, if the printer 10 is in the G/O state, the printer 10 maycommunicate target data (e.g., print data) to be communicated with thetarget device in the client state. The target data may comprise data inthe network layer, which may be a layer higher than the physical layerin the OSI reference model. Therefore, the printer 10 in the G/O statemay execute wireless communication in the network layer with the targetdevice in the client state. Furthermore, the printer 10 in the G/O statemay relay wireless communication between the target device in the clientstate and another device in the client state registered in themanagement list.

(G/O Process)

Referring to FIG. 3, a process to be executed when the printer 10operates as a G/O now is described in more detail. At S40, the controlunit 22 may monitor whether or not an operation for selecting a methodis performed, the operation being executed by a user using the operationunit 14. When the operation for selecting a method has been performed(i.e., YES at S40), the process may proceed to S42.

The operation for selecting a method for a device (i.e., “targetdevice”) with which the printer 10 in the G/O state may establishwireless connection may be performed. In this case, the target devicemay find the printer 10 in the scan process and cause a display unitthereof to display a device list comprising the printer 10. If theprinter 10 is selected from the device list, the target device maytransmit a connection request to the printer 10. The connection requestreceived from the target device may comprise various pieces ofinformation, such as the MAC address and the category of the targetdevice. Thus, the information obtaining unit 44 of the printer 10 mayobtain various pieces of information regarding the target device. Aftertransmitting the connection request to the printer 10, the target devicemay switch to the client state. This may occur because the printer 10may be in the G/O state, and, therefore, the target device may notswitch to the G/O state.

Upon receiving the connection request from the target device, thecontrol unit 22 may execute a WPS negotiation for the G/O state at S42,similar to S26, as depicted in FIG. 2. As a result of the processing atS42, the printer 10 and the target device may use the same wirelessprofile. At S44, the control unit 22 may execute a connection processusing the wireless profile, similar to S28, as depicted in FIG. 2. AtS46, the management unit 40 may newly register the MAC address of thetarget device in the client state in the management list 36, stored inthe memory 32. The connection request received from the target devicemay comprise the MAC address of the target device. When S46 has beencompleted, the process may return to S40.

At S48, the management unit 40 may monitor whether or not a detectionerror signal is obtained from the wireless chip set 17, as depicted inFIG. 1. A device in the client state (i.e., the “client state device”)registered in the management list 36 may transmit signals (hereinafterreferred to as the “regular signals”) to the printer 10 in the G/Ostate. The wireless chip set 17 may receive the regular signalstransmitted by the client state device. For example, when the mobileterminal 80 is the client state device, the mobile terminal 80 may moveout of the range within which wireless communication with the printer 10is possible. In addition, for example, wireless communication betweenthe printer 10 and the client state device may be impossible due to acommunication failure or the like. Further, for example, the power ofthe client state device may be turned off. In such cases, the wirelesschip set 17 may not receive the regular signals transmitted from theclient state device. When a state in which the wireless chip set 17 maynot receive the regular signals from the client state device continuesfor a predetermined period, the wireless chip set 17 may supply adetection error signal to the management unit 40. The detection errorsignal may comprise the MAC address of the client state device for whichregular signals may not be detected. If the management unit 40 obtainsthe detection error signal (i.e., YES at S48), the process may proceedto S52. On the other hand, if the management unit 40 does not obtain thedetection error signal (i.e., NO at S48), the process may proceed toS50.

At S50, the management unit 40 may monitor whether or not a disconnectsignal is obtained from a client state device. For example, if a userwants to remove a client state device from the wireless network, theuser may perform a predetermined operation for the client state device.In this case, the client state device may transmit wirelessly adisconnect signal, indicating that the client state device is beingremoved from the wireless network, to the printer 10 in the G/O state.The disconnect signal may comprise the MAC address of the client statedevice that has transmitted the disconnect signal. When the managementunit 40 has obtained the disconnect signal (i.e. YES at S50), theprocess may proceed to S52.

At S52, the management unit 40 may delete the MAC address in thedetection error signal, obtained at S48, or the MAC address in thedisconnect signal, obtained at S50, from the management list 36. As aresult of the deletion process at S52, the client state device removedfrom the wireless network may no longer be a target to be managed by themanagement unit 40. Hereinafter, the management unit 40 deleting a MACaddress in a detection error signal from the management list 36 will bereferred to as “a client state device may be removed from the wirelessnetwork due to a detection error.” In addition, deleting the MAC addressin a disconnect signal from the management list 36 by the managementunit 40 is referred to as “a client state device may be removed from thewireless network due to a disconnect signal.” When S52 has beencompleted, the process may return to S40.

In an embodiment, when deleting the MAC address of a last client statedevice (hereinafter referred to as the “last client”) from themanagement list 36 at S52, the management unit 40 may cause a temporarystorage area of the memory 32 to store the MAC address of the lastclient and the time (hereinafter referred to as the “last removal time”)at which the MAC address of the last client is deleted. In particular,if the management unit 40 obtains a disconnect signal from the lastclient (i.e., YES at S50), the management unit 40 also may cause thetemporary storage area to store a flag indicating that the disconnectsignal has been obtained. Nevertheless, if the management unit 40 doesnot obtain a disconnect signal (e.g., if the last client is removed dueto a detection error (i.e., YES at S48)), the management unit 40 may notcause the temporary storage area to store the flag.

(G/O Stop Process)

Referring to FIG. 4, a G/O stop process executed by the printer 10according to an embodiment now is described in more detail. At S60, thecontrol unit 22 may judge whether or not the current state of the device(i.e., the printer 10 comprising the control unit 22) may be the G/Ostate. If S60 is judged to be NO (e.g., if the printer 10 is in thedevice state or the client state), the control unit 22 may not executethe processing of S62 through S78. On the other hand, if S60 is judgedto be YES (e.g., if the printer 10 is in the G/O state), the process mayproceed to S62.

At S62, the management unit 40 may judge whether or not the number ofclient state devices is zero. More specifically, the management unit 40may judge whether or not the total number of MAC addresses stored in themanagement list 36 is zero. If S62 is judged to be NO (e.g., if thetotal number of MAC addresses stored in the management list 36 is one ormore), the process may proceed to S78. At S78, the management unit 40may wait for a prescribed time period (for example, 1 second), and thenthe process may return to S60.

On the other hand, if S62 is judged to be YES (e.g., if the number ofMAC addresses stored in the management list 36 is zero), the process mayproceed to S66. At S66, the management unit 40 may judge whether or nota disconnect signal has been obtained from the last client. Morespecifically, at S66, the management unit 40 may judge whether or not aflag indicating that a disconnect signal has been received is stored inthe temporary storage area of the memory 32. If S66 is judged to be YES(e.g., if a flag indicating that a disconnect signal has been obtainedis stored), the process may proceed to S76, without executing theprocessing of S68 through S74.

At S76, the operation control unit 42 may switch the state of theprinter 10 from the G/O state to the device state in order to stop theoperation of the printer 10 as a G/O. In other words, if S66 is judgedto be YES, the operation control unit 42 may stop the operation of theprinter 10 as a G/O immediately in order to refrain from executing theprocessing of S68 through S74. When the operation of the printer 10 as aG/O has been stopped, the wireless network may be lost. Therefore, theprinter 10 may no longer wirelessly communicate target data (e.g., printdata) with other devices. In addition, the printer 10 may no longerrelay wireless communication of target data between a plurality ofdevices in the client state. At S76, the operation control unit 42 maydiscard the wireless profile (i.e., the wireless profile transmitted atS26, depicted in FIG. 2, or S42, depicted in FIG. 3) that has been usedin the wireless network. When S76 has been completed, the process mayreturn to S60.

On the other hand, if S66 is judged to be NO (e.g., if a flag indicatingthat a disconnect signal has been obtained is not stored), the processmay proceed to S68. At S68, the continuation period determination unit46, as depicted in FIG. 1, may determine the end of a continuationperiod. More specifically, the continuation period determination unit 46may determine the end of the continuation period by adding apredetermined time period (for example, 1 minute) to the last removaltime stored in the temporary storage area of the memory 32.

At S70, the operation control unit 42 may wait for a predetermined timeperiod (for example, 1 second). Thereafter, at S72, the management unit40 may judge whether or not a state in which the number of clients iszero continues. The judgment process at S72 may be similar to that atS62. If S72 is judged to be YES (e.g. if the number of clients is zero),the process may proceed to S74.

On the other hand, if S72 is judged to be NO (e.g., if the number ofclients is one or more), the process may return to S60. An example ofthe state in which the number of clients becomes one or more may be asfollows: a communication failure may occur between the printer 10 andthe last client, and the last client may be removed from the wirelessnetwork due to a detection error. Thereafter, the operation forselecting a method for the device that may have been the last client andthe printer 10 may be performed. In this case, S40, as depicted in FIG.3, may be judged to be YES and, after S42 and S44, the device that hasbeen the last client may be registered in the management list 36 againat S46. Thus, the number of clients may become one or more, and S72 maybe judged to be NO.

At S74, the operation control unit 42 may judge whether or not thecontinuation period, the end of which has been determined at S68, haselapsed. If S74 is judged to be NO if the continuation period has notyet elapsed), the process may return to S70. On the other hand, if S74is judged to be YES (e.g., the continuation period has elapsed), theprocess may proceed to S76.

At S76, the operation control unit 42 may switch the state of theprinter 10 from the G/O state to the device state in order to stop theoperation of the printer 10 as a G/O. If S66 is judged to be NO, sincethe processing at S68 through S74 is executed, the operation controlunit 42 may not stop the operation of the printer 10 as a G/Oimmediately, even after the last client is removed. After the lapse ofthe continuation period, the operation control unit 42 may stop theoperation of the printer 10 as a G/O.

Referring to FIG. 5, several examples, in which the G/O stop process, asdepicted in FIG. 4, may be applied, are described in more detail. InFIG. 5, the printer 10 may operate as a G/O; and the printer 70, themobile terminal 80, and the PC 90, as depicted in FIG. 1, may operate asclients.

(Case A1)

The printer 70 may be removed from the wireless network due to adisconnect signal or a detection error. The mobile terminal 80 then maybe removed from the wireless network due to a disconnect signal or adetection error. Thus, in this example, the PC 90 may be the lastclient. The PC 90 may be removed from the wireless network due to adetection error (i.e., YES at S48 and the process may proceed to S52, asdepicted in FIG. 3). Accordingly, the number of client devices thenumber of clients) managed by the printer 10 becomes zero (i.e., YES atS62, as depicted in FIG. 4). As described above, the PC 90, which may bethe last client, may have been removed from the wireless network due toa detection error. Therefore, the printer 10 may judge S66, as depictedin FIG. 4, to be NO, and may determine the end of the continuationperiod (for example, 1 minute) at S68, as depicted in FIG. 4. Theprinter 10 may continue operating, as a G/O until the continuationperiod elapses. In this example, the number of clients may remain zerountil the continuation period elapses. Therefore, the printer 10 mayswitch states, from the G/O state to the device state, after the lapseof the continuation period, and may stop operating as a G/O at S76, asdepicted in FIG. 4.

(Case A2)

In this example, as with Case A1, the printer 70 and then the mobileterminal 80 may be removed from the wireless network. The PC 90, whichmay be the last client, may be removed from the wireless network due toa detection error, as in Example A1 (i.e., NO at S66, as depicted inFIG. 4). Thus, the printer 10 may determine the end of the continuationperiod (for example, 1 minute). In this example, a wireless network maybe reestablished (i.e., reconnected) between the printer 10 and the PC90 before the continuation period elapses. Therefore, the number ofclients may become one before the continuation period elapses (i.e., NOat S72). Consequently, the printer 10 may continue operating as a G/O,even after the lapse of the continuation period.

(Case A3)

In this example, as with Case A1 the printer 70 and then the mobileterminal 80 may be removed from the wireless network. The PC 90, whichmay be the last client, may be removed from the wireless network due toa disconnect signal (i.e., YES at S66, as depicted in FIG. 4).Therefore, the printer 10 may immediately stop operating as a G/O atS76, without executing the processing of S68 through S74, depicted inFIG. 4. In other words, unlike Case A1, in which the printer 10 maycontinue operating as a G/O until the continuation period elapses, inthis example, the printer 10 may stop operating as a G/O before thecontinuation period elapses.

In communication system 2, described above, if the number of clientstate devices becomes zero (i.e., YES at S62, as depicted in FIG. 4),the printer 10 may continue operating as a G/O until the continuationperiod, which begins when the number of client state devices becomeszero, elapses. If the number of client state devices becomes one or morebefore the continuation period elapses, the printer 10 may continueoperating as a G/O, even after the lapse of the continuation period,similar to Case A2, as depicted in FIG. 5. If the number of client statedevices remains zero until the continuation period elapses, the printer10 may stop operating as a G/O in the wireless network upon the lapse ofthe continuation period, similar to Case A1, as depicted in FIG. 5. As aresult, for example, the printer 10 may not need to construct thewireless network again immediately after the wireless network is lost.

For example, a mobile device (e.g., the mobile terminal 80) may be aclient state device. In this example, when carried, the mobile devicemay be removed from the wireless network due to a detection error.According to embodiments of the invention, in such a case, the printer10 may not stop operating as a G/O immediately, and may continueoperating as a G/O until the continuation period elapses. Therefore, ifthe mobile device is reconnected to the wireless network before thecontinuation period elapses, it may be sufficient for the printer 10 toexecute the processing of S42 through S46, as depicted in FIG. 3. Inother words, the printer 10 may not need to execute the processing ofS12 through S22, as depicted in FIG. 2. Accordingly, the processing loadof the printer 10 may be reduced. Thus, the printer 10 may executeoperation as a G/O.

As described above, in embodiments of the invention, when a disconnectsignal has been obtained from the last client, the printer 10 may stopoperating as a G/O immediately, without providing the continuationperiod, similar to Case A3, as depicted in FIG. 5. When a disconnectsignal is obtained from the last client, a user of the last client maywish to remove the last client from the wireless network. Thus, in sucha case, the printer 10 may stop operating as a G/O immediately becauseit is unlikely that the last client will be connected to the wirelessnetwork again. As a result, the printer 10 may stop operating as a G/Oat an earlier point in time, thereby reducing the processing load (i.e.,the load of processing as a G/O) of the printer 10. Further, the printer10 may determine whether or not to provide the continuation period inaccordance with whether or not a disconnect signal has been obtainedfrom the last client. Therefore, the printer 10 may stop operating as aG/O in accordance with whether or not a disconnect signal has beenobtained from the last client.

The printer 10 may be an example of a “wireless communicationapparatus.” A G/O and a client may be examples of a “master station” anda “remote station,” respectively. A client state device may be anexample of a “remote device.” YES at S62 and NO at S66, as depicted inFIG. 4, may be an example of a “first case.” YES at S62 and YES at S66,as depicted in FIG. 4, may be an example of a “second case.” The lastclient may be an example of a “last removed remote device.”

In another embodiment, a holding period table 38 may be stored in thememory 32, which is depicted as the broken-line portion in FIG. 1. Theholding period table 38 may store the categories (e.g., the printer, thePC, the mobile terminal, or the like) of devices and the periods (e.g.,1 minute, 2 minutes, or the like) associated with each other. Inaddition to the above-mentioned printer, PC, and mobile terminal, thecategories of devices stored in the holding period table 38 maycomprise, for example, a television set, a game machine, a digitalcamera, a router, and/or a scanner. In this embodiment, a differentperiod may be associated with each category of devices in the holdingperiod table 38.

For a mobile device (e.g., a mobile terminal), it is likely that themobile device is temporarily moved out of the range, within whichwireless communication of the printer 10 is possible, and then mayreturn to the range, within which wireless communication of the printer10 is possible. In the holding period table 38, a relatively long periodmay be associated with such a category of devices. On the other hand,for example, in the case of a stationary device (e.g., a printer, adesktop PC, or the like), it is unlikely that the stationary devicereturns to the range, within which wireless communication of the printer10 is possible, once the stationary device moves out of the range,within which the wireless communication of the printer 10 is possible.In the holding period table 38, a relatively short period may beassociated with such a category of devices.

In this embodiment, at S30 of FIG. 2, the management unit 40 mayregister the MAC address of a target device in the client state and thecategory of the target device, associating the MAC address and thecategory with each other, in the management list 36 in the memory 32. IfS48, as depicted in FIG. 3, is judged to be YES (i.e., if the lastclient is removed due to a detection error), the management unit 40 maydelete the MAC address and the category of the last client from themanagement list 36 at S52. At this time, the management unit 40 maystore the category of the last client in the temporary storage area ofthe memory 32.

(G/O Stop Process)

Referring to FIG. 6, a G/O stop process according to an embodiment ofthe invention now is described in more detail. The processing of S80through S86 of FIG. 6 may be similar to that of S60 through S66 of FIG.4. In addition, processing of S100 of FIG. 6 may be similar to that ofS78 of FIG. 4.

At S88 (i.e., if the last client is removed due to a detection error),the management unit 40 may identify the category of the last client fromthe temporary storage area of the memory 32. At S90, the continuationperiod determination unit 46 may determine the end of the continuationperiod based on the period corresponding to the category identified atS88. More specifically, at S90, the continuation period determinationunit 46 first may identify the period corresponding to the categoryidentified at S88 from the holding period table 38. The continuationperiod determination unit 46 then may determine the end of thecontinuation period by adding the identified period to the last removaltime stored in the temporary storage area of the memory 32. When S90 hasbeen completed, the process may proceed to S92. The processing of S92through S98 may be similar to that of S70 to S76 of FIG. 4. When S98 hasbeen completed, the process may return to S80.

Referring to FIG. 7, several examples in which the G/O stop process, asdepicted in FIG. 6, may be applied now are described in more detail.

(Case B1)

The PC 90 (e.g., a desktop PC), which may be the last client, may beremoved from the wireless network due to a detection error. At thistime, the number of clients may become zero (i.e., YES at S82, asdepicted in FIG. 6). The printer 10 may identify the category “PC” ofthe PC 90, which may be the last client (S88). Next, the printer 10 maydetermine the end of the continuation period by adding the period,(e.g., “1 minute”) corresponding to the identified category, “PC,” tothe last removal time of the PC 90 (S90). After the lapse of thecontinuation period, the printer 10 may switch the state thereof fromthe G/O state to the device state, in order to stop operating as a G/O(S98).

As described above, in the holding period table 38, a relatively shortperiod may be associated with the category of a stationary device, suchas a desktop PC. Thus, a relatively short period (e.g., 1 minute) may beadopted in this example. This may occur because it is unlikely that astationary device returns to the range, within which wirelesscommunication of the printer 10 is possible, once the stationary devicemoves out of the range, within which wireless communication of theprinter 10 is possible. Therefore, the printer 10 may stop operating asa master station at an earlier point in time, thereby reducing theprocessing load of the printer 10.

(Case B2)

In this example, unlike Case B1, the printer 70 and then the PC 90 maybe removed from the wireless network. The mobile terminal 80, which maybe the last client, may be removed from the wireless network due to adetection error. The printer 10 may identify the category “mobileterminal” of the mobile terminal 80, which may be the last client (i.e.,S88 of FIG. 6). The printer 10 then may determine the end of thecontinuation period by adding the period (e.g., “2 minutes”)corresponding to the identified category, “mobile terminal,” to the lastremoval time of the mobile terminal 80 at S90. In this example, wirelessconnection may be reestablished (i.e., reconnected) between the printer10 and the mobile terminal 80 before the continuation period elapses.Thus, the number of clients may become one before the continuationperiod elapses (i.e., NO in S94). Therefore, the printer 10 may continueoperating as a G/O even after the lapse of the continuation period.

As described above, in the holding period table 38, a relatively longperiod may be associated with the category of a mobile device, such as amobile terminal. Thus, a relatively long period (e.g., 2 minutes) may beadopted in this example. This may occur because it is likely that amobile device returns to the range, within which wireless communicationof the printer 10 is possible, after the mobile device moves out of therange, within which wireless communication of the printer 10 ispossible. Therefore, when the mobile device returns to the range, withinwhich the wireless communication of the printer 10 is possible, theprinter 10 may continue operating as a master station.

In a further embodiment, the holding period table 38 may be stored inthe memory 32. Each time the management unit 40 deletes the MAC addressof a client state device from the management list 36 at S52, as depictedin FIG. 3, the management unit 40 may store the MAC address of theclient state device (hereinafter referred to as the “removed client”),the category of the removed client, and the time (hereinafter referredto as the “removal time”) at which the MAC address of the removed clientmay be removed in the temporary storage area of the memory 32, whileassociating each these pieces of information with one another. In thisexample, if a disconnect signal is obtained from the removed client(i.e., YES at S50, as depicted in FIG. 3), the management unit 40further may store a flag indicating that a disconnect signal has beenobtained in the temporary storage area of the memory 32, whileassociating the flag with the pieces of information described above(e.g., the MAC address, the category, the time, or the like).

(G/O Stop Process)

Referring to FIG. 8, a G/O stop process according to an embodiment ofthe invention now is described in more detail. The processing of S110may be similar to that of S60 of FIG. 4. At S112, the management unit 40may check the number of client state devices. Specifically, themanagement unit 40 may check the number of MAC addresses stored in themanagement list 36. At S114, the management unit 40 may judge whether ornot the number of client state devices has decreased. Specifically, themanagement unit 40 may compare the number of client state devices in theprevious judgment (i.e. previous S112) and the number of client statedevices in the current judgment, in order to judge whether or not thecurrent number of client state devices is less than the previous numberof client state devices. If S114 is judged to be NO if the number ofclient state devices has not decreased), the process may proceed toS134. The processing of S134 may be similar to that of S78 of FIG. 4.

On the other hand, if S114 is judged to be YES (i.e., if the number ofclient state devices has decreased), the management unit 40 may identifya removed client state device at S115. Specifically, the management unit40 may refer to information regarding removed clients stored in thetemporary storage area of the memory 32, and the management unit 40 mayidentify a MAC address (hereinafter referred to as the “latest removedclient”) corresponding to the latest removal time.

At S116, the management unit 40 may judge whether or not a disconnectsignal has been obtained from the latest removed client. Specifically,the management unit 40 may refer to the temporary storage area of thememory 32 and may judge whether or not a flag indicating that adisconnect signal has been obtained is associated with the MAC addressidentified at S115. If S116 is judged to be YES (i.e., if a disconnectsignal has been obtained), the process may proceed to S122, withoutexecuting the processing of S118 and S120 (i.e., without determining aholding period using the holding period determination unit 48, asdepicted in FIG. 1). On the other hand, if S116 is judged to be NO(i.e., if a disconnect signal has not been obtained), the process mayproceed to S118.

At S118, the holding period determination unit 48 may identify acategory corresponding to the MAC address identified at S115 from thetemporary storage area of the memory 32. At S120, the holding perioddetermination unit 48 may determine the end of a holding periodcorresponding to the category identified at S118. Specifically, at S120,the holding period determination unit 48 may identify a periodcorresponding to the category identified at S118 from the holding periodtable 38. The holding period determination unit 48 then may determinethe end of the holding period by adding the identified period (e.g., 1minute) to the removal time of the latest removed client.

At S122, the management unit 40 may judge whether or not the number ofclients is zero. The processing of S122 may be similar to that of S62 ofFIG. 4. If S122 is judged to be YES (i.e., if the number of clients iszero), the continuation period determination unit 46 may determine theend of the continuation period at S124. Specifically, the continuationperiod determination unit 46 may determine the end of the holding periodthat is the longest, among one or more holding periods determined atS120, to be the end of the continuation period. The processing of S126through S132 may be similar to that of S70 through S76 of FIG. 4.

Referring to FIG. 9, several examples in which the G/O stop process, asdepicted in FIG. 8, may be applied now are described in more detail.

(Case C1)

In this example, the printer 70 may be removed from the wireless networkdue to a detection error. In this case, the printer 10 may refer to theholding period table 38 and may identify the period (e.g., “30 seconds”)corresponding to the category: “printer” (S120 in FIG. 8). The printer10 then may determine the end of the holding period by adding theidentified period (e.g., 30 seconds) to the removal time of the printer70 at S120 in FIG. 8. The mobile terminal 80 also may be removed fromthe wireless network due to a detection error. In this case, the printer10 may identify the period (e.g., “2 minutes”) corresponding to thecategory: “mobile terminal,” and the printer 10 may determine the end ofthe holding period at S120 in FIG. 8. The PC 90, which may be the lastclient, may be removed from the wireless network due to a detectionerror. In this case, the printer 10 may identify the period (e.g., “1minute”) corresponding to the category: “PC,” as the holding period inthe same manner as above, and may determine the end of the holdingperiod at S120 in FIG. 8. The printer 10 then may determine the end ofthe holding period of the mobile terminal 80, which may be the longestholding period, among the three holding periods that have beendetermined, to be the end of the continuation period at S124. After thelapse of the continuation period, the printer 10 may switch the statethereof from the G/O state to the device state in order to stopoperating as a G/O at S132.

(Case C2)

In this example, as with Case C1, the printer 70 and then the mobileterminal 80 may be removed from the wireless network, due to detectionerrors. In the same manner as above, the printer 10 may determine theend of the holding period for each of the printer 70 and the mobileterminal 80 at S120 in FIG. 8. The PC 90, which may be the last client,may be removed from the wireless network due to a disconnect signal. Inthis case, the printer 10 may not determine the end of the holdingperiod (i.e., YES at S116). Therefore, the printer 10 may determine theend of the holding period of the mobile terminal 80, which may be thelongest among the two holding periods that have been determined, to bethe end of the continuation period at S124.

As described above, the printer 10 may determine the end of thecontinuation period based on holding periods determined for two or moreremoved clients. In addition, the duration of a holding period to bedetermined may change in accordance with the category of a removedclient. Therefore, the printer 10 may determine the end of thecontinuation period based on one or more categories of one or moreremoved clients. In other words, the printer 10 may stop operating as aG/O at an appropriate timing, in accordance with the categories of theone or more removed clients. As described above, if a disconnect signalis obtained from a removed client (i.e., YES at S116), the printer 10may not determine the holding period based on the category of theremoved client. In other words, the printer 10 may determine acontinuation period, in accordance with whether or not a disconnectsignal has been obtained from the removed client. As a result, theprinter 10 may stop operating as a master station at an appropriatetiming.

In an additional embodiment, the holding period table 38 may not bestored in the memory 32. Thus, S118 of FIG. 8 may not be executed. AtS120 of FIG. 8, the holding period determination unit 48 may identify apredetermined period (for example, 1 minute) as the holding period,regardless of the category of a removed client, and may determine theend of the holding period. If the disconnect signal is obtained from aremoved client (i.e., YES at S116 of FIG. 8), the holding perioddetermination unit 48 may not determine the end of the holding period.

Referring to FIG. 10, an example in which the G/O stop process may beapplied now is described in more detail.

(Case D)

In this example, the printer 70 may be removed from the wireless networkdue to a detection error. In this case, the printer 10 may identify apredetermined period (e.g., “1 minute”) as the holding period, and theprinter 10 may determine the end of the holding period. The mobileterminal 80 also may be removed from the wireless network due to adetection error, in this case, the printer 10 may identify thepredetermined period (e.g., “1 minute”) as the holding period, and theprinter 10 may determine the end of the holding period. The PC 90, whichmay be the last client, may be removed from the wireless network due toa disconnect signal. In this case, the printer 10 may not determine theend of the holding period. Therefore, the printer 10 may determine theend of the holding period of the mobile terminal 80, which may be thelongest among the two holding periods that have been determined, to bethe end of the continuation period.

As described above, the printer 10 may or may not determine the holdingperiod in accordance with whether or not a disconnect signal has beenobtained from a removed client. Therefore, the printer 10 may stopoperating as G/O at an appropriate timing, in accordance with whether ornot a disconnect signal has been obtained from the removed client.

Embodiments of the invention are not limited to the above-describedembodiments, but may be implemented in various forms with variousmodifications, without departing from the scope and spirit of theinvention. Although not a comprehensive listing of modifications,several exemplary modifications now are described in more detail.

In embodiments of the invention, if a disconnect signal is obtained fromthe last client, the continuation period determination unit 46 may notdetermine the continuation period (i.e., S68 may be not executed if S66of FIG. 4 is judged to be YES). In this case, the operation control unit42 may stop the operation of the printer 10 as a G/O immediately afterthe last client is removed at S76 in FIG. 4. Alternatively, even if adisconnect signal is obtained from the last client, the continuationperiod determination unit 46 may determine the continuation period. Ingeneral, when the number of remote devices to be managed becomes zero,the operation control unit 42 may continue the operation of the printer10 as a master station until the continuation period, which begins whenthe number of remote devices becomes zero, elapses.

In embodiments of the invention, if a disconnect signal is obtained froma removed client, the holding period determination unit 48 may notdetermine the holding period. Alternatively, even if a disconnect signalis obtained from a removed client, the holding period determination unit48 may determine the holding period.

“First-type remote devices” may comprise both a remote device that maybe removed by supplying a disconnect signal and a remote device that maybe removed without supplying a disconnect signal. A “wirelesscommunication apparatus” is not limited to the printer 10, and the“wireless communication apparatus” may be another device capable ofexecuting wireless communication (e.g., a cell phone, a personal digitalassistant (PDA), a PC, a server, a fax machine, a copying machine, ascanner, a multifunction device, or the like).

In the above-described embodiments, the wireless chip set 17 may supplya detection error signal to the management unit 40 when a state in whichthe regular signals cannot be received from a client state devicecontinues for a predetermined time period (i.e., a detection error).Alternatively, when data (e.g., print data) is to be transmitted to atarget client state device, the wireless chip set 17 may supply adetection error signal to the management unit 40 if the transmission ofthe data is not completed, even after a certain number of trials.

In the above-described embodiments, the components 40 through 48 maycomprise the CPU 30 of the printer 10, executing the processing inaccordance with software. Alternatively, at least some of the components40 through 48 may comprise hardware, such as a logic circuit.

While the invention has been described in connection with variousexample structures and illustrative embodiments, it will be understoodby those skilled in the art that other variations and modifications ofthe structures, configurations, and embodiments described above may bemade without departing from the scope of the invention. For example,this application may comprise any possible combination of the variouselements and features disclosed herein, and the particular elements andfeatures presented in the claims and disclosed above may be combinedwith each other in other ways within the scope of the application, suchthat the application should be recognized as also directed to otherembodiments comprising any other possible combinations. Otherstructures, configurations, and embodiments will be apparent to thoseskilled in the art from a consideration of the specification or thepractice of the invention disclosed herein. It is intended that thespecification and the described examples may be illustrative ofembodiments of the invention, with the true scope of the invention beingdefined by the following claims.

What is claimed is:
 1. A wireless communication apparatus configured tooperate selectively as a master station or as a remote station in awireless network, comprising: a processor configured to operate as: amanagement unit configured to manage one or more remote devices, whichoperate as remote stations in a particular wireless network, when thewireless communication apparatus operates as the master station in theparticular wireless network; and an operation control unit configured tocontinue the operation of the wireless communication apparatus as themaster station, when the wireless communication apparatus operates asthe master station in the particular wireless network, until acontinuation period elapses when the number of remote devices to bemanaged is zero, wherein the continuation period begins at a time whenthe number of remote devices to be managed becomes zero, wherein, if thenumber of remote devices to be managed becomes one or more before thecontinuation period elapses, the operation control unit is configured tocontinue the operation of the wireless communication apparatus as themaster station in the particular wireless network, even after a lapse ofthe continuation period, and wherein, if the number of remote devices tobe managed remains zero until the continuation period elapses, theoperation control unit is configured to stop the operation of thewireless communication apparatus as the master station after the lapseof the continuation period.
 2. The wireless communication apparatusaccording to claim 1, wherein, when the number of remote devices to bemanaged becomes zero without obtaining a disconnect signal from a lastremoved remote device, which is a last device that has been removed fromthe particular network, among the one or more remote devices to bemanaged, the operation control unit is configured to continue theoperation of the wireless communication apparatus as the master stationuntil the continuation period elapses, and wherein, when the number ofremote devices to be managed becomes zero while the disconnect signal isobtained from the last removed remote device, the operation control unitis configured to stop the operation of the wireless communicationapparatus as the master station before the continuation period elapses.3. The wireless communication apparatus according to claim 1, whereinthe operation control unit comprises: a holding period determinationunit configured to: determine a holding period that begins when thefirst-type remote device is removed from the particular wirelessnetwork, each time a first-type remote device among the one or moreremote devices to be managed is removed from the particular wirelessnetwork, and not determine the holding period if a second-type remotedevice among the one or more remote devices to be managed is removedfrom the particular wireless network; and a continuation perioddetermination unit configured to determine an end of the holding periodthat is the longest, among one or more holding periods determined by theholding period determination unit, as an end of the continuation period,when the number of remote devices to be managed becomes zero, whereinthe first-type remote device is a remote device that is removed from theparticular wireless network without supplying a disconnect signal to thewireless communication apparatus, and wherein the second-type remotedevice is a remote device that is removed from the particular wirelessnetwork by supplying the disconnect signal to the wireless communicationapparatus.
 4. The wireless communication apparatus according to claim 1,wherein the operation control unit comprises: an information obtainingunit configured to obtain, from each of the one or more remote devicesto be managed, category data indicating a category of each of the one ormore remote devices to be managed; and a continuation perioddetermination unit configured to determine an end of the continuationperiod based on the category data obtained from the one or more remotedevices to be managed.
 5. The wireless communication apparatus accordingto claim 4, wherein, when the number of remote devices to be managedbecomes zero, the continuation period determination unit determines theend of the continuation period based only on the category data obtainedfrom a last removed remote device, which is a last device that has beenremoved from the particular wireless network among the one or moreremote devices to be managed.
 6. The wireless communication apparatusaccording to claim 4, further comprising: a memory configured to store aplurality of category data and corresponding periods, associating eachof the category data with each period, wherein the continuation perioddetermination unit determines the end of the continuation period basedon a period associated with the category data obtained from the lastremoved remote device.
 7. The wireless communication apparatus accordingto claim 4, wherein the operation control unit further comprises: aholding period determination unit configured to determine a holdingperiod based on the category data obtained from the first-type remotedevice, each time a first-type remote device, among the one or moreremote devices to be managed, is removed from the particular wirelessnetwork, wherein the holding period begins when the first-type remotedevice is removed from the particular wireless network, and wherein,when the number of remote devices to be managed becomes zero, theholding period determination unit is configured to determine an end ofthe holding period that is the longest, among one or more holdingperiods determined by the holding period determination unit, as an endof the continuation period.
 8. The wireless communication apparatusaccording to claim 7, wherein, if a second-type remote device, among theone or more remote devices to be managed, is removed from the particularwireless network, the holding period determination unit does notdetermine the holding period, wherein the first-type remote device is aremote device that is removed from the particular wireless networkwithout supplying a disconnect signal to the wireless communicationapparatus, and wherein the second-type remote device is a remote devicethat is removed from the particular wireless network by supplying thedisconnect signal to the wireless communication apparatus.
 9. Thewireless communication apparatus according to claim 7, furthercomprising: a memory configured to store a plurality of category dataand corresponding periods, associating each of the category data witheach period, wherein, each time the first-type remote device is removedfrom the particular wireless network, the holding period determinationunit is configured to determine an end of the holding period based on aperiod associated with the category data obtained from the first-typeremote device.
 10. A non-transitory, computer-readable storage mediumcomprising computer-readable instructions for a processor of a wirelesscommunication apparatus configured to operate selectively as a masterstation or a remote station in a wireless network, the computer-readableinstructions instructing the processor to perform the steps of: managingone or more remote devices that operate as remote stations in theparticular wireless network, when the wireless communication apparatusoperates as the master station in a particular wireless network; andcontrolling the operation of the wireless communication apparatus, whenthe wireless communication apparatus operates as the master station inthe particular wireless network, to continue as the master station untila continuation period elapses when the number of remote devices to bemanaged is zero, wherein the continuation period begins when the numberof remote devices to be managed becomes zero, wherein the controllingstep comprises continuing the operation of the wireless communicationapparatus as the master station in the particular wireless network, evenafter a lapse of the continuation period, if the number of remotedevices to be managed becomes one or more before the continuation periodelapses, and wherein the controlling step comprises stopping theoperation of the wireless communication apparatus as the master stationafter the lapse of the continuation period, if the number of remotedevices to be managed remains zero until the continuation periodelapses.
 11. A wireless communication apparatus configured to operateselectively as a master station or a remote station in a wirelessnetwork, comprising: a management unit configured to manage one or moreremote devices that operate as remote stations in a particular wirelessnetwork, when the wireless communication apparatus operates as themaster station in the particular wireless network; and an operationcontroller configured to continue the operation of the wirelesscommunication apparatus as the master station, when the wirelesscommunication apparatus operates as the master station in the particularwireless network, until a continuation period elapses when the number ofremote devices to be managed is zero, wherein the continuation periodbegins when the number of remote devices to be managed becomes zero,wherein, if the number of remote devices to be managed becomes one ormore before the continuation period elapses, the operation controller isconfigured to continue the operation of the wireless communicationapparatus as the master station in the particular wireless network, evenafter a lapse of the continuation period, and wherein, if the number ofremote devices to be managed remains zero until the continuation periodelapses, the operation controller is configured to stop the operation ofthe wireless communication apparatus as the master station after thelapse of the continuation period.
 12. The wireless communicationapparatus according to claim 11, wherein, when the number of remotedevices to be managed becomes zero without obtaining a disconnect signalfrom a last removed remote device, which is a last device that has beenremoved from the particular network, among the one or more remotedevices to be managed, the operation controller is configured tocontinue the operation of the wireless communication apparatus as themaster station until the continuation period elapses, and wherein, whenthe number of remote devices to be managed becomes zero while thedisconnect signal is obtained from the last removed remote device, theoperation controller is configured to stop the operation of the wirelesscommunication apparatus as the master station before the continuationperiod elapses.
 13. The wireless communication apparatus according toclaim 11, further comprising: a holding period determination unitconfigured to: determine a holding period that begins when thefirst-type remote device is removed from the particular wirelessnetwork, each time a first-type remote device among the one or moreremote devices to be managed is removed from the particular wirelessnetwork, and not determine the holding period if a second-type remotedevice among the one or more remote devices to be managed is removedfrom the particular wireless network; and a continuation perioddetermination unit configured to determine an end of the holding periodthat is the longest, among one or more holding periods determined by theholding period determination unit, as an end of the continuation period,when the number of remote devices to be managed becomes zero, whereinthe first-type remote device is a remote device that is removed from theparticular wireless network without supplying a disconnect signal to thewireless communication apparatus, and wherein the second-type remotedevice is a remote device that is removed from the particular wirelessnetwork by supplying the disconnect signal to the wireless communicationapparatus.
 14. The wireless communication apparatus according to claim11, further comprising: an information obtaining unit configured toobtain, from each of the one or more remote devices to be managed,category data indicating a category of each of the one or more remotedevices to be managed; and a continuation period determination unitconfigured to determine an end of the continuation period based on thecategory data obtained from the one or more remote devices to bemanaged.
 15. The wireless communication apparatus according to claim 14,wherein, when the number of remote devices to be managed becomes zero,the continuation period determination unit determines the end of thecontinuation period based only on the category data obtained from a lastremoved remote device, which is a last device that has been removed fromthe particular wireless network among the one or more remote devices tobe managed.
 16. The wireless communication apparatus according to claim14, further comprising: a memory configured to store a plurality ofcategory data and corresponding periods, associating each of thecategory data with each period, wherein the continuation perioddetermination unit determines the end of the continuation period basedon a period associated with the category data obtained from the lastremoved remote device.
 17. The wireless communication apparatusaccording to claim 14, further comprising: a holding perioddetermination unit configured to determine a holding period based on thecategory data obtained from the first-type remote device, each time afirst-type remote device, among the one or more remote devices to bemanaged, is removed from the particular wireless network, wherein theholding period begins when the first-type remote device is removed fromthe particular wireless network, and wherein, when the number of remotedevices to be managed becomes zero, the holding period determinationunit is configured to determine an end of the holding period that is thelongest, among one or more holding periods determined by the holdingperiod determination unit, as an end of the continuation period.
 18. Thewireless communication apparatus according to claim 17, wherein, if asecond-type remote device, among the one or more remote devices to bemanaged, is removed from the particular wireless network, the holdingperiod determination unit does not determine the holding period, whereinthe first-type remote device is a remote device that is removed from theparticular wireless network without supplying a disconnect signal to thewireless communication apparatus, and wherein the second-type remotedevice is a remote device that is removed from the particular wirelessnetwork by supplying the disconnect signal to the wireless communicationapparatus.
 19. The wireless communication apparatus according to claim17, further comprising: a memory configured to store a plurality ofcategory data and corresponding periods, associating each of thecategory data with each period, wherein, each time the first-type remotedevice is removed from the particular wireless network, the holdingperiod determination unit is configured to determine an end of theholding period based on a period associated with the category dataobtained from the first-type remote device.